#include "wxsautoresourcetreeimage.h"
#include "wxsresourcetree.h"

wxsAutoResourceTreeImage::wxsAutoResourceTreeImage( const wxString& FileName, bool DontFree ) {
  m_Index = wxsResourceTree::LoadImage( FileName );
  m_DontFree = DontFree;
}

wxsAutoResourceTreeImage::wxsAutoResourceTreeImage( const wxBitmap& Image, bool DontFree ) {
  m_Index = wxsResourceTree::InsertImage( Image );
  m_DontFree = DontFree;
}

wxsAutoResourceTreeImage::~wxsAutoResourceTreeImage() {
  if( !m_DontFree ) {
    wxsResourceTree::FreeImage( m_Index );
  }
}
